//
//  JTMeTableViewCell.m
//  百思不得姐
//
//  Created by Robin Zhang on 2016/12/23.
//  Copyright © 2016年 BeiJingWangDianJieTong. All rights reserved.
//

#import "JTMeTableViewCell.h"

@implementation JTMeTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
//        [self.imageView setContentMode:UIViewContentModeScaleAspectFit];
        [self.textLabel setTextColor:[UIColor darkGrayColor]];
        [self setAccessoryType:UITableViewCellAccessoryDisclosureIndicator];
//        [self setAccessoryView:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"arrow"]]];
        
        [self setBackgroundView:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mainCellBackground"]]];
    }
    
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    if (!self.imageView.image) return;
    
    // imageVIew
    [self.imageView setJt_y:JTSmallMargin];
    [self.imageView setJt_height:self.contentView.jt_height - self.imageView.jt_y * 2];
    [self.imageView setJt_width:self.imageView.jt_height];
    
    // label
    [self.textLabel setJt_x:self.imageView.jt_right + JTMargin];
}

@end
